- @meta = { :description => "#{@category.name} posts.",:keywords => "#{@category.name}"}
- @section = @category.name

-unless @active_users.empty?
  -widget do
    %h4
      .small=:top_writers.l
    %ul.list-unstyled
      - @active_users.each do |user|
        = render :partial => "users/sidebar_user", :locals => {:user => user} 

-unless @popular_posts.empty?
  -widget do
    %h4
      .small=:popular_category.l(:name => @category.name)
    %ul.list-unstyled
      - @popular_posts.each do |post|
        =render :partial => 'posts/sidebar_post', :locals => {:post => post}

- if logged_in?
  %h2.signup=:have_something_to_contribute.l
  %ul.list-unstyled
    %li=link_to fa_icon('check', :text => @category.display_new_post_text() || :write_new_post.l(:category=>@category.name)), new_user_post_path({:user_id => current_user, :category_id => @category.id})
- else
  %h2.signup= @category.display_new_post_text() || :write_new_post.l(:category=>@category.name)
  %ul.list-unstyled
    %li
      =link_to fa_icon('check', :text => :sign_up_for_an_account.l), signup_url
    %li
      %small
        =:have_an_account.l
        =link_to fa_icon('arrow-right', :text => :login.l), login_url

%h2      
  =:show_category.l :category => @category.name
%ul
  %li= link_to :recent.l, category_path(@category), {:class => (params[:popular] ? '' : 'active')}
  %li= link_to :popular.l, category_path(@category, :popular => 'DESC'), {:class => (params[:popular] ? 'active' : '')}  

= render :partial => 'posts/post', :collection => @posts      
= paginate @posts, :theme => 'bootstrap'
  